\hypertarget{transmission_8h}{\section{include/transmission.h File Reference}
\label{transmission_8h}\index{include/transmission.\-h@{include/transmission.\-h}}
}


Header file for transmission handler.  


\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structt__config__struct}{t\-\_\-config\-\_\-struct}
\begin{DoxyCompactList}\small\item\em structure of transmission configuration \end{DoxyCompactList}\item 
struct \hyperlink{structt__buffer__struct}{t\-\_\-buffer\-\_\-struct}
\begin{DoxyCompactList}\small\item\em structure of transmission buffer \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{transmission_8h_ad4d796b98c583d49e83adabd74a63bf6}{\#define \hyperlink{transmission_8h_ad4d796b98c583d49e83adabd74a63bf6}{M\-A\-X\-\_\-\-B\-U\-F\-F\-E\-R\-\_\-\-S\-I\-Z\-E}~255}\label{transmission_8h_ad4d796b98c583d49e83adabd74a63bf6}

\begin{DoxyCompactList}\small\item\em Maximum size for transmission buffer $\ast$/. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{transmission_8h_a284b4a9e63d48cd157962b2447516b82}{t\-\_\-proto} \{ \hyperlink{transmission_8h_a284b4a9e63d48cd157962b2447516b82a7c2d86b6055480bd86bece1f6e5af208}{T0}, 
\hyperlink{transmission_8h_a284b4a9e63d48cd157962b2447516b82a623238751deb7764bdebf4799fe30f07}{T1}
 \}
\begin{DoxyCompactList}\small\item\em Transmission protocol enumeration. \end{DoxyCompactList}\item 
enum \hyperlink{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5}{t\-\_\-baudrate} \{ \hyperlink{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5a86d7bec7ffa5d95b1b73c494821e567f}{B9600}, 
\hyperlink{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5af975fbd1b044c9494e3b8bc23c746560}{B19200}, 
\hyperlink{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5accba157b6983e9577b802caa11c3f3a5}{B38400}, 
\hyperlink{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5acc2daa508b31c15a10d5c8e33a3ef533}{B111600}
 \}
\begin{DoxyCompactList}\small\item\em Transmission Baudrate enumeration. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{transmission_8h_ac85e578e6bc21cacc03b398d47433e26}{trans\-Init} (\hyperlink{structt__config__struct}{t\-\_\-config\-\_\-struct} config)
\begin{DoxyCompactList}\small\item\em Initialize the transmission handler. \end{DoxyCompactList}\item 
void \hyperlink{transmission_8h_a1de9404b5817c6a4c51eea56c32eedf3}{trans\-Rx} ()
\begin{DoxyCompactList}\small\item\em Receive the command A\-P\-D\-U. \end{DoxyCompactList}\item 
void \hyperlink{transmission_8h_a8497de52bba7fac4d237d1b534292cde}{trans\-Tx} ()
\begin{DoxyCompactList}\small\item\em Transmit the response A\-P\-D\-U. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hypertarget{transmission_8h_aadee74ae5233b517f258a1919adc6b40}{\hyperlink{structt__config__struct}{t\-\_\-config\-\_\-struct} \hyperlink{transmission_8h_aadee74ae5233b517f258a1919adc6b40}{tconfig}}\label{transmission_8h_aadee74ae5233b517f258a1919adc6b40}

\begin{DoxyCompactList}\small\item\em transmission configuration \end{DoxyCompactList}\item 
\hypertarget{transmission_8h_a44fa5815cec6ce2c305d2b112d7f0479}{\hyperlink{structt__buffer__struct}{t\-\_\-buffer\-\_\-struct} \hyperlink{transmission_8h_a44fa5815cec6ce2c305d2b112d7f0479}{rx\-\_\-buffer}}\label{transmission_8h_a44fa5815cec6ce2c305d2b112d7f0479}

\begin{DoxyCompactList}\small\item\em buffer for Rx transmission \end{DoxyCompactList}\item 
\hypertarget{transmission_8h_adb01de2ad4f205ab9dce5a3fa68689c2}{\hyperlink{structt__buffer__struct}{t\-\_\-buffer\-\_\-struct} \hyperlink{transmission_8h_adb01de2ad4f205ab9dce5a3fa68689c2}{tx\-\_\-buffer}}\label{transmission_8h_adb01de2ad4f205ab9dce5a3fa68689c2}

\begin{DoxyCompactList}\small\item\em buffer for Tx transmission \end{DoxyCompactList}\item 
\hypertarget{transmission_8h_afc9a91164387a3937d037c76adc8d59b}{\hyperlink{pintaros_8h_ad097ffa75536dc17a0039dfb3781d705}{uint16\-\_\-t} \hyperlink{transmission_8h_afc9a91164387a3937d037c76adc8d59b}{exp\-\_\-data}}\label{transmission_8h_afc9a91164387a3937d037c76adc8d59b}

\begin{DoxyCompactList}\small\item\em length of command data expected by command interpreter \end{DoxyCompactList}\item 
\hypertarget{transmission_8h_ab910ab91409cf0f0e246a59d92a4d183}{bool \hyperlink{transmission_8h_ab910ab91409cf0f0e246a59d92a4d183}{busy\-\_\-flag}}\label{transmission_8h_ab910ab91409cf0f0e246a59d92a4d183}

\begin{DoxyCompactList}\small\item\em indication for transmission protocol if the main loop still busy \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Header file for transmission handler. \begin{DoxyAuthor}{Author}
Ricky Hariady (\href{mailto:ricky.hariady@enter.web.id}{\tt ricky.\-hariady@enter.\-web.\-id})
\end{DoxyAuthor}
\begin{DoxyDate}{Date}
7/10/2013 
\end{DoxyDate}


\subsection{Enumeration Type Documentation}
\hypertarget{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5}{\index{transmission.\-h@{transmission.\-h}!t\-\_\-baudrate@{t\-\_\-baudrate}}
\index{t\-\_\-baudrate@{t\-\_\-baudrate}!transmission.h@{transmission.\-h}}
\subsubsection[{t\-\_\-baudrate}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf t\-\_\-baudrate}}}\label{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5}


Transmission Baudrate enumeration. 

\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{B9600@{B9600}!transmission.\-h@{transmission.\-h}}\index{transmission.\-h@{transmission.\-h}!B9600@{B9600}}\item[{\em 
\hypertarget{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5a86d7bec7ffa5d95b1b73c494821e567f}{B9600}\label{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5a86d7bec7ffa5d95b1b73c494821e567f}
}]Baudrate 9.\-600 bit/s. \index{B19200@{B19200}!transmission.\-h@{transmission.\-h}}\index{transmission.\-h@{transmission.\-h}!B19200@{B19200}}\item[{\em 
\hypertarget{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5af975fbd1b044c9494e3b8bc23c746560}{B19200}\label{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5af975fbd1b044c9494e3b8bc23c746560}
}]Baudrate 19.\-200 bit/s. \index{B38400@{B38400}!transmission.\-h@{transmission.\-h}}\index{transmission.\-h@{transmission.\-h}!B38400@{B38400}}\item[{\em 
\hypertarget{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5accba157b6983e9577b802caa11c3f3a5}{B38400}\label{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5accba157b6983e9577b802caa11c3f3a5}
}]Baudrate 38.\-400 bit/s. \index{B111600@{B111600}!transmission.\-h@{transmission.\-h}}\index{transmission.\-h@{transmission.\-h}!B111600@{B111600}}\item[{\em 
\hypertarget{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5acc2daa508b31c15a10d5c8e33a3ef533}{B111600}\label{transmission_8h_a5266b5ad080839acc7a5223b0ca0e1b5acc2daa508b31c15a10d5c8e33a3ef533}
}]Baudrate 111.\-600 bit/s. \end{description}
\end{Desc}
\hypertarget{transmission_8h_a284b4a9e63d48cd157962b2447516b82}{\index{transmission.\-h@{transmission.\-h}!t\-\_\-proto@{t\-\_\-proto}}
\index{t\-\_\-proto@{t\-\_\-proto}!transmission.h@{transmission.\-h}}
\subsubsection[{t\-\_\-proto}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf t\-\_\-proto}}}\label{transmission_8h_a284b4a9e63d48cd157962b2447516b82}


Transmission protocol enumeration. 

\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{T0@{T0}!transmission.\-h@{transmission.\-h}}\index{transmission.\-h@{transmission.\-h}!T0@{T0}}\item[{\em 
\hypertarget{transmission_8h_a284b4a9e63d48cd157962b2447516b82a7c2d86b6055480bd86bece1f6e5af208}{T0}\label{transmission_8h_a284b4a9e63d48cd157962b2447516b82a7c2d86b6055480bd86bece1f6e5af208}
}]Using T0 Protocol. \index{T1@{T1}!transmission.\-h@{transmission.\-h}}\index{transmission.\-h@{transmission.\-h}!T1@{T1}}\item[{\em 
\hypertarget{transmission_8h_a284b4a9e63d48cd157962b2447516b82a623238751deb7764bdebf4799fe30f07}{T1}\label{transmission_8h_a284b4a9e63d48cd157962b2447516b82a623238751deb7764bdebf4799fe30f07}
}]Using T1 Protocol. \end{description}
\end{Desc}


\subsection{Function Documentation}
\hypertarget{transmission_8h_ac85e578e6bc21cacc03b398d47433e26}{\index{transmission.\-h@{transmission.\-h}!trans\-Init@{trans\-Init}}
\index{trans\-Init@{trans\-Init}!transmission.h@{transmission.\-h}}
\subsubsection[{trans\-Init}]{\setlength{\rightskip}{0pt plus 5cm}int trans\-Init (
\begin{DoxyParamCaption}
\item[{{\bf t\-\_\-config\-\_\-struct}}]{config}
\end{DoxyParamCaption}
)}}\label{transmission_8h_ac85e578e6bc21cacc03b398d47433e26}


Initialize the transmission handler. 


\begin{DoxyParams}{Parameters}
{\em config} & The initialization structure \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Result\par
 Success = O\-K\par
 Not Success = Error 
\end{DoxyReturn}
\hypertarget{transmission_8h_a1de9404b5817c6a4c51eea56c32eedf3}{\index{transmission.\-h@{transmission.\-h}!trans\-Rx@{trans\-Rx}}
\index{trans\-Rx@{trans\-Rx}!transmission.h@{transmission.\-h}}
\subsubsection[{trans\-Rx}]{\setlength{\rightskip}{0pt plus 5cm}void trans\-Rx (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{transmission_8h_a1de9404b5817c6a4c51eea56c32eedf3}


Receive the command A\-P\-D\-U. 

Call by I\-O Interrupt handler \hyperlink{hal_8h_a9bf20d3fd04aedb2ea857abb4c494586}{H\-A\-L\-\_\-\-I\-O\-\_\-\-I\-S\-R()}, then read the data byte by \hyperlink{hal_8h_a136930f47e2cdb4cdd6bc147b9703b0f}{H\-A\-L\-\_\-\-I\-O\-\_\-\-Rx\-Byte()}. The command A\-P\-D\-U received then placed in rx\-\_\-buffer

\begin{DoxyReturn}{Returns}
none 
\end{DoxyReturn}
\hypertarget{transmission_8h_a8497de52bba7fac4d237d1b534292cde}{\index{transmission.\-h@{transmission.\-h}!trans\-Tx@{trans\-Tx}}
\index{trans\-Tx@{trans\-Tx}!transmission.h@{transmission.\-h}}
\subsubsection[{trans\-Tx}]{\setlength{\rightskip}{0pt plus 5cm}void trans\-Tx (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{transmission_8h_a8497de52bba7fac4d237d1b534292cde}


Transmit the response A\-P\-D\-U. 

Transmit the response A\-P\-D\-U from tx\-\_\-buffer. Call by Response Manager.

\begin{DoxyReturn}{Returns}
none 
\end{DoxyReturn}
